package com.JAVAIO;

import java.io.*;

public class WTT
{
    public static final String name = "123马钊mazhao123\n";

    public static void main(String[] args) throws IOException
    {
//        fun1();
//        fun2();
        fun3();
    }

    public static void fun1() throws IOException
    {
        FileWriter fw = new FileWriter("F:/b.txt",true);
        fw.write("mazhao\n");
        fw.write("mazhao\n");
        fw.flush();
        fw.close();
    }

    public static void fun2() throws IOException
    {
        File file = new File("F:/c.txt");
        if (!file.exists())
        {
            file.createNewFile();
        }
        byte[] bytes = name.getBytes();
        int b = bytes.length;
        OutputStream out = new FileOutputStream(file);
        out.write(bytes, 0, 6);
        out.close();
    }

    public static void fun3() throws IOException
    {
        FileOutputStream out = new FileOutputStream("F:/d.txt",true);
        out.write(name.getBytes());
        out.close();
    }

}
